package com.itxckf.service.impl;

import com.itxckf.mapper.ProductsMapper;
import com.itxckf.pojo.Comments;
import com.itxckf.pojo.Products;
import com.itxckf.service.ProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class  ProductsServiceImpl implements ProductsService {
    @Autowired
    private ProductsMapper productsMapper;
    @Override
    public List<Products> getProductsList(String name) {
        return productsMapper.getProductsList(name);
    }
    public List<Products> getProductsListMini(String name) {
        return productsMapper.getProductsListMini(name);
    }

    @Override
    public void addProducts(Products products) {
        productsMapper.addProducts(products);
    }

    @Override
    public void deleteProducts(Short id) {
        productsMapper.deleteProducts(id);
    }

    @Override
    public void updateProducts(Products products) {
        productsMapper.updateProducts(products);
    }

    @Override
    public List<Comments> getProductsComment(Short id) {
        return productsMapper.getProductsComment(id);
    }

    @Override
    public void addProductsComment(Comments comments) {
        productsMapper.addProductsComment(comments);
    }
}
